package com.mohunhun.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

@Data
@Schema(description = "用户信息")
public class User {

    @Schema(description = "用户ID")
    private Long id;

    @Schema(description = "用户名")
    private String username;


    @Schema(description = "密码（加密存储）")
    @JsonIgnore//不参与序列化
    private String password;

    @Schema(description = "用户昵称")
    private String nickname;

    @Schema(description = "手机号")
    private String phoneNum;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "性别：0-未知，1-男，2-女")
    private Byte gender;

    @Schema(description = "加密盐")
    @JsonIgnore//不参与序列化
    private String salt;

    @Schema(description = "头像URL")
    @JsonInclude(JsonInclude.Include.ALWAYS)
    private String avatarUrl;

    @Schema(description = "文章发布数量")
    private Integer articleCount;

    @Schema(description = "是否管理员：0-否，1-是")
    private Byte isAdmin;

    @Schema(description = "用户备注")
    private String remark;

    @Schema(description = "账号状态：0-禁用，1-启用")
    private Byte state;

    @Schema(description = "删除状态：0-未删除，1-已删除")
    @JsonIgnore
    private Byte deleteState;

    @Schema(description = "创建时间")
    private Date createTime;

    @Schema(description = "更新时间")
    private Date updateTime;

    private String avatarHash;
}